/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package marmicc;

import java.sql.*;
/**
 *
 * @author marmicc
 */
public class Conn {
    
    public static void main(String[] args) throws Exception{
    
    Class.forName("com.mysql.jdbc.Driver");
            Connection con = DriverManager.getConnection(
                    "jdbc:mysql://localhost:3306/gielda", "root", ""
                    );
     PreparedStatement statement = con.prepareStatement(
             "Select * from user");
     ResultSet result = statement.executeQuery();
     
     while(result.next())
     {
         System.out.println(result.getString(1)+ " " + result.getString(2));
     }
    
    }
}
